from time import sleep
from selenium import webdriver

url = 'https://image.baidu.com/search/index?tn=baiduimage&ipn=r&ct=201326592&cl=2&lm=-1&st=-1&fm=detail&fr=&hs=0&xthttps=111110&sf=1&fmq=1615714773579_R&pv=&ic=0&nc=1&z=&se=&showtab=0&fb=0&width=&height=&face=0&istype=2&ie=utf-8&word=%E6%B7%B1%E5%9C%B3&oq=%E6%B7%B1%E5%9C%B3&rsp=-1'
Broswer = webdriver.Chrome()
Broswer.get(url)
Broswer.maximize_window()

Images = []
while len(Images) < 50:
    Broswer.execute_script("window.scrollTo(0,document.body.scrollHeight)")
    sleep(1)
    Images = Broswer.find_elements_by_css_selector('div.imgbox img[class="main_img img-hover"]')
    # print("Image长度：", len(Images))

url_fifty = Images[49].get_attribute('data-imgurl')
print(url_fifty)
Broswer.get(url_fifty)
sleep(5)

Broswer.quit()
